'use strict';
/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // 获取农场列表
    router.get('/api/farm/list', controller.farmInfo.allList);
    // 获取设备
    router.get('/api/farm/device/list', controller.deviceInfo.allList);
    // 获取农场下的视频列表
    router.get('/api/farm/video/list', controller.videoRecord.allList);
    // api数据
    router.get('/api/farm/summary', controller.dailySummary.getSummaryData);

    router.resources('farm', '/api/farm', controller.farmInfo);

    router.get('/api/device/refresh', controller.deviceInfo.refresh);
    router.get('/api/dict/refresh', controller.dict.refresh);

  /**
   * 兔场
   */
    router.get('/api/rabbit/roomList', controller.rabbitRoom.allList);
    // 同步房间
    router.get('/api/rabbit/roomSync', controller.rabbitRoom.sync);
    router.post('/api/rabbit/data', controller.rabbitRoom.staticData);
    router.post('/api/rabbit/bodyWeight', controller.rabbitRoom.bodyWeight)
    router.post('/api/rabbit/unhealthy', controller.rabbitRoom.unhealthy)
    // 气温综合评价
    router.post('/api/rabbit/temEvaluate', controller.rabbitRoom.temEvaluate)
    // 气温阈值
    router.post('/api/rabbit/temThreshold', controller.rabbitRoom.temThreshold)
    // 设备
    router.post('/api/rabbit/deviceInfo', controller.rabbitRoom.deviceInfo);
};
